home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-01-15 | 1.2 KB | 50 lines | [TEXT/MPS ] |
- #if qDebug
- pascal void Assertion(const Boolean condition, const Str255 &description)
- #else
- pascal void Assertion(const Boolean condition, const Str255 &)
- #endif
-
- {
- if (!condition) {
- #if qDebug
- GetCallersMethodName(pWho);
- if (CanReadLn()) {
- cout << "Assertion failed in " << pWho << ": " << description << "\n";
- EnterMacAppDebugger();
- if (ReadYesNo("Do you want to signal failure?"))
- Failure(minErr, 0); /* ??? silent failure, but someday 0 messages
- need to be non-silent */
- } else {
- DebugStr("Assertion failed in " + pWho + ": " + description);
- Failure(minErr, 0); /* ??? silent failure, but someday 0 messages
- need to be non-silent */
- }
- #else
- Failure(minErr, 0); /* ??? silent failure, but someday 0 messages
- need to be non-silent */
- #endif
-
- }
- }
-
-
- pascal void FailOSErr(short error)
- {
- #if qDebug
- if (gAskFailure && (error == noErr) && CanReadLn()) {
- short debugError;
-
- GetCallersMethodName(pWho);
- debugError = ReadInteger("FailOSErr called by " + pWho + ". Enter return error: ");
- if (debugError != noErr)
- Failure(debugError, 0);
- }
- #else
- if (error != noErr)
- Failure(error, 0);
- #endif
- }
-
-
-
-